#pragma once

#include <QtSql>
#include <QQueue>
#include <QString>
#include <QMutex>
#include <QMutexLocker>
#include <QWaitCondition>
#include <QSharedPointer>
#include <QSqlDatabase>
#include "ConnectionPool.h"


// one connect per thread
class ConnMySqHelper
{

public:
	ConnMySqHelper();
	~ConnMySqHelper();

public:
	static void initDbPool(const ConnInfo_Db& dbInfo);
	static QSharedPointer<ConnMySqHelper> GetThreadMySqlHelp();

public:
	bool testLocalDbConn();
	bool local_createSiteDataBase(QString& tablename, QString& constructSentence);
	bool select(const QString& cmd, QVector<QSqlRecord>& last_query_result);
	bool execSqlCmd(const QString& op);
};

